<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>生成静态</h1>
	<div class="buttons">
		<a href="javascript:;" class="on" id="index">更新首页</a>
		<a href="javascript:;" id="article">更新文章</a>
		<a href="javascript:;" id="archive">文章归档</a>
		<a href="javascript:;" id="tag">标签列表</a>
		<a href="javascript:;" id="link">友情链接</a>
		<a href="javascript:;" id="clear">页面清理</a>
	</div>
	</div>
	<div class="main">
	
<script type="text/javascript">
$(function () {
	$(".buttons a").each(function () {
		$(this).click(function () {
			$(".buttons a").each(function(){
				$(this).attr('class','');
				$("#tab_" + $(this).attr('id')).css('display','none');
			});
			$(this).attr('class', 'on');
			$("#tab_" + $(this).attr('id')).css('display','block');

		});
	});
});
function check_all(obj) {
	if ($(obj).attr('checked')) {
		$(":input[name='filelist[]']").each(function() {
			$(this).attr('checked','checked');
		});
	} else {
		$(":input[name='filelist[]']").each(function() {
			 $(this).removeAttr('checked');
		});
	}
}
</script>

	<table class="sub">
		<tr><td>
		<table id="tab_index">
			<form name="makehtml" method="get" target="do_create" action="admin.php">
			<input type="hidden" name="m" value="createhtml" />
			<input type="hidden" name="f" value="index" />
			<tr>
				<td>
				<p>为了降低静态页面更新复杂度，只生成一个页面并取消首页分页功能。静态首页默认放在网站根目录下。</p>
				<input type="submit" value="  开始生成HTML  " class="button" />
				</td>
			</tr>
			</form>
		</table>
		<table id="tab_article" style="display:none">
			<form name="makehtml" method="get" target="do_create" action="admin.php">
			<input type="hidden" name="m" value="createhtml" />
			<input type="hidden" name="f" value="article" />
			<tr>
				<td>选择分类：
					<select name="cid">
						<option value="">---所有分类---</option>
						<?php echo get_category_options()?>
					</select>
				</td>
			</tr>
			<tr>
				<td>开始ID：<input type="text" name="start" size="10" /><span>空或0表示重头开始</span></td>
			</tr>
			<tr>
				<td>结束ID：<input type="text" name="end" size="10" /><span>空或0表示直到结束ID</span></td>
			</tr>
			<tr>
				<td>每次创建页面数量：&nbsp;<input type="text" name="pagesize" size="10" value="20" /><span>个</span></td>
			</tr>
			<tr>
				<td><input type="submit" value="  开始生成HTML  " class="button" /></td>
			</tr>
			</form>
		</table>
		<table id="tab_archive" style="display:none">
			<form name="makehtml" method="get" target="do_create" action="admin.php">
			<input type="hidden" name="m" value="createhtml" />
			<input type="hidden" name="f" value="archive" />
			<tr>
				<td>
				<p>生成的HTML文件默认放在网站根目录下的archive.html。</p>
				<input type="submit" value="  开始生成HTML  " class="button" />
				</td>
			</tr>
			</form>
		</table>
		<table id="tab_tag" style="display:none">
			<form name="makehtml" method="get" target="do_create" action="admin.php">
			<input type="hidden" name="m" value="createhtml" />
			<input type="hidden" name="f" value="tag" />
			<tr>
				<td>
				<p>生成的HTML文件默认放在网站根目录下的tag.html</p>
				<input type="submit" value="  开始生成HTML  " class="button" />
				</td>
			</tr>
			</form>
		</table>
		<table id="tab_link" style="display:none">
			<form name="makehtml" method="get" target="do_create" action="admin.php">
			<input type="hidden" name="m" value="createhtml" />
			<input type="hidden" name="f" value="link" />
			<tr>
				<td>
				<p>生成的HTML文件默认放在网站根目录下的link.html</p>
				<input type="submit" value="  开始生成HTML  " class="button" />
				</td>
			</tr>
			</form>
		</table>
		<table id="tab_clear" style="display:none">
			<form name="clear_file" id="clear_file" method="post" target="do_create" action="admin.php">
			<input type="hidden" name="m" value="createhtml" />
			<input type="hidden" name="f" value="clear" />
			<tr>
				<td>
				<p>请选择你要删除的文件或文件夹。</p>
				<p><?
				$len = count($data);
				for ($i=0; $i<$len; $i++) {
				?>
					<input type="checkbox" name="filelist[]" value="<?=$data[$i][0]?>" class="checkbox" id="f_<?=$i?>" /><label for="f_<?=$i?>"><?=$data[$i][1]?></label><br />
				<?}?>
				<input type="checkbox" name="chkall" id="chkall" value="1" class="checkbox" onclick="check_all(this)" /> <label for="chkall">全选</label>
				</p>
				<input type="submit" value="  开始清理  " class="button" />
				</td>
			</tr>
			</form>
		</table>
		</td></tr>
		<tr><th>生成状态</th></tr>
		<tr>
			<td height="100">
			<iframe name="do_create" frameborder="0" id="do_create" width="100%" height="100%"></iframe>
			</td>
		</tr>
	</table>
	</div>
</div>
{admintemplate footer}